<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
	<link rel="stylesheet" type="text/css" href="css/creers.css">
</head>
<body>
	<div class="bannerS">
		
		<!-- 导航栏 -->
	<div class="nav ">
		<div class="banner">
			<img src="https://www.buchouwang.com/img/logo.a2dacc49.png">
		</div>
		<div class="nav-center">
			<a href="./index.html" class="item-on">首页 <span></span></a>
			<a href="javascript:;" class="product">产品介绍 <span></span>
				<div class="Invisibility">
				<div class="subnav"></div>
			</div>
			</a>
			
			<a href="./sec.html">解决方案 <span></span></a>
			<a href="./cases.html">案例展示 <span></span></a>
			<a href="./news.html">新闻中心 
				<span></span>
				
			</a>
			<a href="./about.html">关于我们 <span></span></a>
			<a href="./careers.html">加入我们 
				<span></span>
			</a>
			<a href="./pig.html">生猪交易 <span></span></a>
			<a href="./demo.html">申请演示 <span></span></a>
		</div>
        	
	</div>
	<div class="bantie">
			<div class="bancon">
				<div class="banner-title">加入我们</div>
				<div class="banner-info">加入我们</div>
			</div>
		</div>
</div>
	<div class="content">
		<div class="contentPage">
			<span>首页 > 关于我们 > </span>
			<span>加入我们</span>
		</div>
		<div class="contentWrap">
			<div class="contentTitle">职位展示</div>
			<div class="tabWrap">
				<ul class="clearfix"></ul>
			</div>
			<div class="listWrap">
				<ul class="clearfix"></ul>
			</div>
			<div class="el-pagination">
				<div class="switchPage">
					<span class="Total">共 14 条</span>
					<button class="btnprev" disabled="disabled"><</button>
					<ul>
						<li class="number active">1</li>
						<li class="number">2</li>
						<li class="number">3</li>
					</ul>
					<button class="btnnext">></button>
					<span class="pagejump">前往<input type="number"name="">页</span>
				</div>
			</div>
		</div>
	</div>
	
	<script type="text/javascript" src="ajax.js"></script>
	<script type="text/javascript" src="jquery-3.2.1.js"></script>
	<script type="text/javascript">
		console.log(location.href)
		let id = location.href.split('=')[1];



			//二级导航
			let subnav = document.querySelector(".subnav")
			ajax({
			  method: "get",
			  url: "stage-api/website/getProductMenuInfo",
			}).then(res => {
			  for(let i = 0; i < res.data.length; i++){
			    if (i == 4) {
			      continue;
			    }else if(i == 6){
			      continue;
			    }else{
			      subnav.innerHTML += `<div class="subtag" onclick=detail('${res.data[i].productId}')>
			                            <img src=${res.data[i].menuIcon.split("?")[0]}>
			                            <p>${res.data[i].productName}</p >
			                            </div>`
			    }
			  }
			})

			  function detail(productId){
			    location.href = `po.html?productId=${productId}`
			  }
			  $(".product").hover(function(){
				  $(".Invisibility").css("display", "block")
				}, function(){
				  $(".Invisibility").css("display", "none")
				})

			  //案例展示
			let tabul = document.querySelector(".tabWrap ul")
			ajax({
			  method: "get",
			  url: "stage-api/website/dict/data/list",
			  params: {
			    dictType: "job_type",
			  }
			}).then(res => {
			  for(let i = 0; i < res.rows.length; i++){
			    tabul.innerHTML += `<li class="tabitem" onclick=position(${res.rows[i].dictValue})>${res.rows[i].dictLabel}<p class="line"></p ></li>`

			  }
			})


			ajax({
			    method: "get",
			    url: "stage-api/website/job/list",
			    params: {
			      pageNum: 1,
			      pageSize: 6,
			    }
			  }).then(res => {
			    tabul.children[0].className = "itemon tabitem"
			      for(let i = 0; i < res.rows.length; i++){
			        listul.innerHTML += `<li class="itemWrap page1">
			                              <div class="item">
			                                <div class="title">${res.rows[i].postName}</div>
			                                <ul class="labelWrap clearfix">
			                                  <li class="labelItem">${res.rows[i].jobAddress}</li>
			                                  <li class="labelItem">${res.rows[i].jobRequireAge}</li>
			                                  <li class="labelItem"><span></span></li>
			                                </ul>
			                                <div class="salary">${res.rows[i].salary}</div>
			                                <div class="infor">${res.rows[i].jobDescription}</div>
			                                <div class="btn">申请职位</div>
			                              </div>
			                            <li>`
			      }
		let degrees = document.querySelectorAll(".labelItem span")
	      for(let j = 0; j < res.rows.length; j++){
	        console.log(res.rows[j].jobRequireEdu)
	        if(res.rows[j].jobRequireEdu == 1){
	          degrees[j].innerText = "专科"
	        }else{
	          degrees[j].innerText = "本科"
	        }
	      }
	  })
	  ajax({
	    method: "get",
	    url: "stage-api/website/job/list",
	    params: {
	      pageNum: 2,
	      pageSize: 6,
	    }
	  }).then(res => {
	      for(let i = 0; i < res.rows.length; i++){
	        listul.innerHTML += `<li class="itemWrap page2">
	                              <div class="item">
	                                <div class="title">${res.rows[i].postName}</div>
	                                <ul class="labelWrap clearfix">
	                                  <li class="labelItem">${res.rows[i].jobAddress}</li>
	                                  <li class="labelItem">${res.rows[i].jobRequireAge}</li>
	                                  <li class="labelItem"><span></span></li>
	                                </ul>
	                                <div class="salary">${res.rows[i].salary}</div>
	                                <div class="infor">${res.rows[i].jobDescription}</div>
	                                <div class="btn">申请职位</div>
	                              </div>
	                            <li>`
	      }
	      let degrees = document.querySelectorAll(".labelItem span")
		      for(let j = 0; j < res.rows.length; j++){
		        if(res.rows[j].jobRequireEdu == 1){
		          degrees[j].innerText = "专科"
		        }else{
		          degrees[j].innerText = "本科"
		        }
		      }
		  })
		  ajax({
		    method: "get",
		    url: "stage-api/website/job/list",
		    params: {
		      pageNum: 3,
		      pageSize: 6,
		    }
		  }).then(res => {
		      for(let i = 0; i < res.rows.length; i++){
		        listul.innerHTML += `<li class="itemWrap page3">
		                              <div class="item">
		                                <div class="title">${res.rows[i].postName}</div>
		                                <ul class="labelWrap clearfix">
		                                  <li class="labelItem">${res.rows[i].jobAddress}</li>
		                                  <li class="labelItem">${res.rows[i].jobRequireAge}</li>
		                                  <li class="labelItem"><span></span></li>
		                                </ul>
		                                <div class="salary">${res.rows[i].salary}</div>
		                                <div class="infor">${res.rows[i].jobDescription}</div>
		                                <div class="btn">申请职位</div>
		                              </div>
		                            <li>`
		      }
		      let degrees = document.querySelectorAll(".labelItem span")
		      for(let j = 0; j < res.rows.length; j++){
		        console.log(res.rows.jobRequireEdu)
		        if(res.rows[j].jobRequireEdu == 1){
		          degrees[j].innerText = "专科"
		        }else{
		          degrees[j].innerText = "本科"
		        }
		      }
		  })
		let listul = document.querySelector(".listWrap ul")
		let total = document.querySelector(".Total")
		let num = document.querySelectorAll(".number")
		let inp = document.querySelector(".pagejump input")
		function position(dictValue){
			// 删除类名然后切换样式
			document.querySelector(".itemon").classList.remove("itemon")
			// 获取类名添加样式
			document.querySelectorAll(".tabitem")[dictValue].classList.add("itemon")
  		  listul.innerHTML = ""
		  ajax({
		    method: "get",
		    url: "stage-api/website/job/list",
		    params: {
		      pageNum: 1,
		      pageSize: 6,
		      jobType: dictValue,
		    }
		  }).then(res => {
	      for(let i = 0; i < res.rows.length; i++){
	        listul.innerHTML += `<li class="itemWrap page1">
	                              <div class="item">
	                                <div class="title">${res.rows[i].postName}</div>
	                                <ul class="labelWrap clearfix">
	                                  <li class="labelItem">${res.rows[i].jobAddress}</li>
	                                  <li class="labelItem">${res.rows[i].jobRequireAge}</li>
	                                  <li class="labelItem"><span></span></li>
	                                </ul>
	                                <div class="salary">${res.rows[i].salary}</div>
	                                <div class="infor">${res.rows[i].jobDescription}</div>
	                                <div class="btn">申请职位</div>
	                              </div>
	                            <li>`
	      }
	      let degrees = document.querySelectorAll(".labelItem span")
	      for(let j = 0; j < res.rows.length; j++){
	        if(res.rows[j].jobRequireEdu == 1){
	          degrees[j].innerText = "专科"
	        }else{
	          degrees[j].innerText = "本科"
	        }
	      }
	      total.innerText = `共 ${res.total} 条`
	      
	 	 })
		   ajax({
		    method: "get",
		    url: "stage-api/website/job/list",
		    params: {
		      pageNum: 2,
		      pageSize: 6,
		      jobType: dictValue,
		    }
			  }).then(res => {
			      for(let i = 0; i < res.rows.length; i++){
			        listul.innerHTML += `<li class="itemWrap page2">
			                              <div class="item">
			                                <div class="title">${res.rows[i].postName}</div>
			                                <ul class="labelWrap clearfix">
			                                  <li class="labelItem">${res.rows[i].jobAddress}</li>
			                                  <li class="labelItem">${res.rows[i].jobRequireAge}</li>
			                                  <li class="labelItem"><span></span></li>
			                                </ul>
			                                <div class="salary">${res.rows[i].salary}</div>
			                                <div class="infor">${res.rows[i].jobDescription}</div>
			                                <div class="btn">申请职位</div>
			                              </div>
			                            <li>`
			      }
			      let degrees = document.querySelectorAll(".labelItem span")
			      for(let j = 0; j < res.rows.length; j++){
			        if(res.rows[j].jobRequireEdu == 1){
			          degrees[j].innerText = "专科"
			        }else{
			          degrees[j].innerText = "本科"
			        }
			      }
			    })
			ajax({
		    method: "get",
		    url: "stage-api/website/job/list",
		    params: {
		      pageNum: 3,
		      pageSize: 6,
		      jobType: dictValue,
		    }
		  }).then(res => {
		      for(let i = 0; i < res.rows.length; i++){
		        listul.innerHTML += `<li class="itemWrap page3">
		                              <div class="item">
		                                <div class="title">${res.rows[i].postName}</div>
		                                <ul class="labelWrap clearfix">
		                                  <li class="labelItem">${res.rows[i].jobAddress}</li>
		                                  <li class="labelItem">${res.rows[i].jobRequireAge}</li>
		                                  <li class="labelItem"><span></span></li>
		                                </ul>
		                                <div class="salary">${res.rows[i].salary}</div>
		                                <div class="infor">${res.rows[i].jobDescription}</div>
		                                <div class="btn">申请职位</div>
		                              </div>
		                            <li>`
		      }
		      let degrees = document.querySelectorAll(".labelItem span")
		      for(let j = 0; j < res.rows.length; j++){
		        if(res.rows[j].jobRequireEdu == 1){
		          degrees[j].innerText = "专科"
		        }else{
		          degrees[j].innerText = "本科"
		        }
		      }
		    })
		  }
		num[2].onclick = function(){
       	num[0].className = "number"
       	num[1].className = "number"
        this.className = "number active"
        $(".page1").css("display", "none")
        $(".page2").css("display", "none")
        $(".page3").css("display", "block")
        $(".btnnext").attr("disabled", true)
        $(".btnprev").attr("disabled", false)
      }

      num[1].onclick = function(){
        num[0].className = "number"
        num[2].className = "number"
        this.className = "number active"
        $(".page1").css("display", "none")
        $(".page3").css("display", "none")
        $(".page2").css("display", "block")
        $(".btnnext").attr("disabled", false)
        $(".btnprev").attr("disabled", false)
      }

      num[0].onclick = function(){
        num[1].className = "number"
        num[2].className = "number"
        this.className = "number active"
        $(".page3").css("display", "none")
        $(".page2").css("display", "none")
        $(".page1").css("display", "block")
        $(".btnprev").attr("disabled", true)
        $(".btnnext").attr("disabled", false)
      }
      $(".btnnext").click(function(){
        document.querySelector(".active").nextElementSibling.onclick()
      }) 
      $(".btnprev").click(function(){
        document.querySelector(".active").previousElementSibling.onclick()
      }) 
      $(".pagejump input").blur(function(){
        if(inp.value >= 3){
          inp.value = 3;
          num[2].onclick()
        }else if(inp.value <= 1){
          inp.value = 1;
          num[0].onclick()
        }else{
          inp.value = 2;
          num[1].onclick()
        }
      })
	</script>
</body>
</html>